﻿using Services;

namespace Api.Controllers
{
    /// <summary>
    /// 检测报告
    /// </summary>
    public class MHCheckController : EditingBaseController<MHCheckModel, MHCheckFilterModel, IMHCheckLogic>
    {
        public MHCheckController(ICurrentUser currentUser, IMHCheckLogic logic)
            : base(currentUser, logic)
        { }

        [HttpGet]
        [Route("{deviceId}")]
        public async Task<long?> GetLastCheckTime(int deviceId)
        {
            try
            {
                return await _logic.GetLastCheckTime(deviceId);
            }
            catch (Exception ex)
            {
                throw new CustomException($"获取设备最后检查时间时发生错误: {ex.Message}");
            }
        }
    }
}
